<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/purchasereturnfolder/PurchaseReturn.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/purchasereturnfolder/PurchaseReturn.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'OrderReturnId',
                footer: "Foots",
                cnName: '采购退货',
                name: 'purchasereturnfolder/PurchaseReturn',
                url: "/PurchaseReturn/",
                sortName: "OrderReturnId"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"OrderReturnId":"","PurchaseCode":"","ProductName":""});
            const searchFormOptions = ref([[{"title":"退货单号","field":"OrderReturnId","type":"text"},{"title":"采购单号","field":"PurchaseCode","type":"text"},{"title":"产品名称","field":"ProductName","type":"text"}]]);
            const columns = ref([{field:'OrderReturnId',title:'退货单号',type:'string',width:220,readonly:true,require:true,align:'left',sort:true},
                       {field:'PurchaseCode',title:'采购单号',type:'string',width:220,align:'left'},
                       {field:'ProductName',title:'产品名称',type:'string',width:110,align:'left'},
                       {field:'ProductCode',title:'产品编号',type:'string',width:220,align:'left'},
                       {field:'ProductSKU',title:'产品规格',type:'string',width:110,align:'left'},
                       {field:'Unit',title:'单位',type:'string',width:220,align:'left'},
                       {field:'Price',title:'单价',type:'decimal',width:110,align:'left'},
                       {field:'SaleReturnNum',title:'退货数',type:'int',width:110,align:'left'},
                       {field:'TotalAmount',title:'总额',type:'decimal',width:110,align:'left'},
                       {field:'SupplierName',title:'供应商名称',type:'string',width:110,align:'left'},
                       {field:'OrderStatus',title:'采购订单状态',type:'int',bind:{ key:'OrderState',data:[]},width:110,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'IsDeleted',title:'是否删除',type:'sbyte',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
